package com.ajavaer.framework.im.tencent.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

/**
 * 消息体
 */
public class TencentMsgBody {
    @JsonProperty("MsgType")
    private TencentImMsgType msgType;
    @JsonProperty("MsgContent")
    @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "MsgType")
    @JsonSubTypes({
            @JsonSubTypes.Type(value = TencentMsgTextElem.class, name = "TIMTextElem"),
            @JsonSubTypes.Type(value = TencentMsgLocationElem.class, name = "TIMLocationElem"),
            @JsonSubTypes.Type(value = TencentMsgFaceElem.class, name = "TIMFaceElem"),
            @JsonSubTypes.Type(value = TencentMsgCustomElem.class, name = "TIMCustomElem"),
            @JsonSubTypes.Type(value = TencentMsgImageElem.class, name = "TIMImageElem"),
            @JsonSubTypes.Type(value = TencentMsgFileElem.class, name = "TIMFileElem")
    })
    private TencentMsgContent msgContent;

    public TencentMsgBody() {
    }

    public TencentMsgBody(TencentImMsgType msgType, TencentMsgContent msgContent) {
        this.msgType = msgType;
        this.msgContent = msgContent;
    }

    public TencentImMsgType getMsgType() {
        return msgType;
    }

    public void setMsgType(TencentImMsgType msgType) {
        this.msgType = msgType;
    }

    public TencentMsgContent getMsgContent() {
        return msgContent;
    }

    public void setMsgContent(TencentMsgContent msgContent) {
        this.msgContent = msgContent;
    }

}
